package com.smarthome.domain.enums;


/**
 * <B>Description</B> 支付宝的appId字段枚举 <br />
 * <B>Copyright</B> Copyright (c) 2016 www.smarthome.com All rights reserved. <br />
 * 本软件源代码版权归xxxx,未经许可不得任意复制与传播.<br />
 * <B>Company</B> smarthome
 * @createTime 2016年4月27日 下午11:14:43
 * @author KongXiangyu
 */
public enum AppIdEnum {
    PROPERTY("property", "物业费"), ORDERS("orders", "订单费用");

    private String code;
    private String name;

    private AppIdEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static AppIdEnum getByCode(String code) {
        for (AppIdEnum appId : values()) {
            if (appId.getCode().equals(code)) {
                return appId;
            }
        }
        throw new IllegalArgumentException("none-defined AppIdEnum,code:" + code);
    }

    public String getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

}
